package com.shengde.jinwawaforleader.model.myJob.classList;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.shengde.jinwawaforleader.R;
import com.shengde.jinwawaforleader.base.BaseActivity;
import com.shengde.jinwawaforleader.model.myJob.classStatus.PrivateStatusActivity;

/**
 * Created by Chason on 2016/12/23.
 */

public class WorkOfTeacherActivity extends BaseActivity{

    private TextView tv_back,tv_title;
    private RelativeLayout rl_classwork,rl_classstatues;
    private String teacherid;
    private String teachername;

    @Override
    public void onRoot(Bundle savedInstanceState) {
        setContentView(R.layout.activity_workofteacher);
    }

    @Override
    public void initView() {
        tv_back = (TextView)findViewById(R.id.tv_back);
        tv_title = (TextView)findViewById(R.id.tv_title);
        rl_classwork = (RelativeLayout)findViewById(R.id.rl_classwork);
        rl_classstatues = (RelativeLayout)findViewById(R.id.rl_classstatues);
    }

    @Override
    public void initData() {
        teacherid = getIntent().getStringExtra("teacherid");
        teachername = getIntent().getStringExtra("teachername");
        tv_title.setText(teachername+"的工作");
    }

    @Override
    public void initListener() {
        tv_back.setOnClickListener(this);
        rl_classwork.setOnClickListener(this);
        rl_classstatues.setOnClickListener(this);
    }

    @Override
    public void onWidgetClick(View view) {
        Intent intent;
        switch (view.getId()) {
            case R.id.tv_back:
                finish();
                break;
            case R.id.rl_classwork:
                intent = new Intent(this, ClassWorkActivity.class);
                intent.putExtra("teacherid",teacherid);
                startActivity(intent);
                break;
            case R.id.rl_classstatues:
                intent = new Intent(this, PrivateStatusActivity.class);
                intent.putExtra("teacherid",teacherid);
                startActivity(intent);
                break;
        }
    }
}
